<template>
  <div class="topBar">
    <div class="logo">
      <img src="/public/logo.png" alt="" class="logo-inner">
    </div>
    <div class="inner">
      <div class="title">
        <div class="main-title">
          分布式政务数据中心安全共享平台
        </div>
        <div class="sub-title">
          门户系统
        </div>
      </div>
    </div>
    <div class="main-button">
      <el-button :icon="EditPen" @click="goLogin">修改标识按钮</el-button>
      <el-button :icon="SwitchButton" class="main-button-2" @click="exit">退出系统按钮</el-button>
      <el-button :icon="House" class="main-button-2" @click="goDataFactory">数据工厂入口</el-button>
      <el-button :icon="House" class="main-button-2" @click="goLogin">平台维护入口</el-button>
    </div>
    <div class="info">
      <ul class="info_nav">
        <li>部门：{{ form.department }}</li>
        <li>用户角色：{{ form.role }}</li>
        <li>用户名：{{ form.name }}</li>
      </ul>
    </div>
    <div class="msg">
      <p v-for="(item, index) in msgArray" :key="index">
        <svg t="1695646046625" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2737" width="16" height="16"><path d="M372.2496 329.9584L208.64 481.4592h-107.52v163.84a64.1792 64.1792 0 0 0 64 64h212.48l107.52 99.5328V289.4592c0-35.2-58.1376-10.1632-112.8704 40.4992z" fill="#EE7C3D" p-id="2738"></path><path d="M572.16 243.9936v533.7856l-138.9056-128.6144-23.552-21.7856H183.04v-232.96H409.6l23.552-21.8112 139.008-128.6144m65.8944-139.9296c-21.0688 0-59.7248 22.5792-96.8448 56.9344l-163.6096 151.5008h-212.48a64.1792 64.1792 0 0 0-64 64v268.8a64.1792 64.1792 0 0 0 64 64h212.48l163.6096 151.4752c37.0944 34.3552 75.776 56.9344 96.8448 56.9344 10.0096 0 16.0256-5.12 16.0256-16.4096v-780.8c0-11.3408-6.0416-16.4352-16.0256-16.4352zM881.92 551.8592h-86.8608a40.96 40.96 0 0 1 0-81.92h86.8608a40.96 40.96 0 0 1 0 81.92zM880.64 921.9328a40.8064 40.8064 0 0 1-28.9792-12.0064l-90.3424-90.3424A40.96 40.96 0 0 1 819.2 761.6512l90.3424 90.3424A40.96 40.96 0 0 1 880.64 921.9328zM795.2384 269.312a40.96 40.96 0 0 1-28.9536-69.9136l85.3248-85.3248a40.96 40.96 0 0 1 57.9328 57.9328L824.32 257.3312a40.96 40.96 0 0 1-29.0816 11.9808z" fill="#333333" p-id="2739"></path></svg>
        {{item}}
      </p>
    </div>
  </div>
</template>

<script setup lang="ts">
import {reactive, ref} from "vue";
import {useRouter} from "vue-router";
import {EditPen, SwitchButton, House} from "@element-plus/icons-vue";

const $router = useRouter()
const form = ref({
  department: "hfuu",
  role: 'administrators',
  name: 'zh'
})
const goLogin = () => {
  $router.push('/login')
}
const goDataFactory= () => {
  $router.push('/data_factory')
}
const exit = () => {
  console.log("退出")
}
const msgArray  = reactive([
  '分布式政务数据中心安全共享平台',
  '数字签名验证算法流程',
  '随机数发生器',
])
</script>

<style scoped>
.topBar {
  background: url("/public/back.jpeg");
  background-size: cover;
  height: 170px;
  width: 100%;
}

.logo {
  float: left;
  width: 170px;
}

.logo-inner {
  height: 150px;
}
.inner {
  overflow: hidden;
  width: calc(100% - 170px);
}

.title {
  margin-top: 8px;
  margin-left: calc((70% - 700px)/2);
  float: left;
}

.main-title {
  font-size: 45px;
  margin-left: 170px;
  color: rgb(11, 49, 115);
  width: 700px;
  font-weight: bold;
}

.sub-title {
  font-size: 28px;
  color: rgb(98, 99, 100);
  margin-top: 20px;
  margin-left: 55%;
  width: 155px;
}

.main-button {
  float: right;
  margin-top: -98px;
  width: 150px;
}

.main-button-2 {
  margin-top: 3px;
  margin-left: 0 !important;
}

.info {
  width: calc(100% - 170px);
  color: rgb(110, 116, 136);
  font-size: 15px;
  position: relative;
  top: 5px;
  left: 40px;
}

.info_nav {
  list-style: none;
  padding: 0;
  display: flex;
}

.info_nav li {
  width: 34%;
  line-height: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.msg {
  width: 100%;
  height: 28px;
  background-color: rgb(221, 223, 229);
  color: rgb(230, 17, 17);
  line-height: 30px;
  position: relative;
  top: -10px;
  overflow: hidden;
}

.msg p {
  display: inline-block;
  white-space: nowrap;
  animation: scroll 15s linear infinite;
  margin-right: 50px;
}
.msg svg {
  position: relative;
  top: 2px;
}
@keyframes scroll {
  0% {
    transform: translateX(100vw); /* 从右侧向左滚动 */
  }
  100% {
    transform: translateX(-100vw); /* 滚动到左侧 */
  }
}

:deep(.el-button) {
  background: rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
</style>